package com.wyth.lottery.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.wyth.lottery.R;
import com.wyth.lottery.base.BaseActivity;
import com.wyth.lottery.base.SaveUtils;
import com.wyth.lottery.utils.MyApplication;
import com.wyth.lottery.utils.QRUtils;
import com.wyth.lottery.utils.QrCodeUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class PrintErrorActivity extends BaseActivity {

    @BindView(R.id.iv_qr_gzh)
    ImageView ivQrGzh;
    @BindView(R.id.iv_qr_noprint)
    ImageView ivQrNoprint;
    @BindView(R.id.tv_nopaper)
    TextView tvNopaper;
    @BindView(R.id.tv_notice)
    TextView tvNotice;
    @BindView(R.id.but_back)
    Button butBack;
    private Bitmap bitmap = null;

    @Override
    protected int getContentID() {
        return R.layout.activity_print_error;
    }

    @Override
    protected void initView() {
        //未打印号码
        String noPrint = getIntent().getStringExtra("noPrintNumber");
        bitmap = QRUtils.enCode(noPrint, 909, 909, R.mipmap.ic_launcher, false);
        ivQrNoprint.setImageBitmap(bitmap);

    }

    @Override
    protected void initDate() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.but_back)
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.but_back:
                //返回首页
                startActivity(new Intent(MyApplication.getContext(), MainActivity.class));
                finish();
                break;

            default:
                break;
        }

    }

}
